package sk.xorty.transformers;

import org.springframework.integration.annotation.Transformer;
import org.springframework.stereotype.Component;
import sk.xorty.domain.Trade;

import java.util.HashMap;
import java.util.Map;

@Component
public class TradeMapTransformer {

    @Transformer
    public Map<String, ?> transform(Trade trade) {
        Map<String, Object> map = new HashMap<>();
        map.put("id", trade.getId());
        map.put("account", trade.getAccount());
        map.put("direction", trade.getDirection());

        return map;
    }
}
